import React, {FC, useState} from 'react';
import "./index.less";
import HxKwNavs from "@/components/HxKwNavs";
import {history} from "@@/core/history";
import {FormattedMessage, Outlet} from "umi";
import {useLocation} from "@@/exports";

interface FavoriteProps {
}

/**
 * 收藏夹 页面
 */
const Favorite: FC<FavoriteProps> = (props) => {
  const location = useLocation();
  return (
    <div className={"favorite-container"}>
      <HxKwNavs
        className={"favorite-kw-navs"}
        value={location.pathname}
        onChange={(value) => {
          history.push({
            pathname: value,
          });
        }}
        items={[
          {key: "/mine/favorite/journal-period", label:  <FormattedMessage id="text.journal" />},
          {key: "/mine/favorite/column", label:   <FormattedMessage id="text.column" />},
          {key: "/mine/favorite/article", label:  <FormattedMessage id="text.article" />},
        ]}
      >
        <Outlet/>
      </HxKwNavs>
    </div>
  );
};

export default Favorite;
